<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script src="../js/vue.js" type="text/javascript"></script>
<body>
    		
    <div id="app">
        <h2>{{msg}}，今天天气很{{isHost ? 炎热 : 寒冷}}</h2>
		<!-- 绑定事件的时候：@xxx="yyy" yyy可以写一些简单的语句 -->
		<!-- <button @click="isHot = !isHot">切换天气</button> -->
		 <button @click="changeWeather">切换天气</button>
    </div>
    
</body>
<script>
    new Vue({
        el:'#app',
		data:{
			msg:'监视属性-天气案例',
			isHost:true
		},
		computed:{
			// info(){
			// 	return this.isHost ? '炎热' : '寒冷'
			// }
		},
		methods: {
			changeWeather(){
				this.isHost = !this.isHost
			}
		},
    })
</script>
</html>